package car.aistar.controller.loadjsp;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

/**
 * 本类用于：
 *
 * @author 许华钢
 * @Classname AdminJsp
 * @Description TODO
 * @date 2020/10/12 9:39
 */
@Controller
@RequestMapping("/AdminJsp")
public class AdminJsp {

    @RequestMapping("/toAddCar")
    public String toAddCar(){
        return "adCenter/AddCar";
    }

    @RequestMapping("/toAddOwner")
    public String toAddOwner(){
        return "adCenter/AddOwner";
    }

    @RequestMapping("/toNewCarPage")
    public String toNewCarPage(){
        return "page/newCarPage";
    }

    @RequestMapping("/toNewCarMain/{carID}")
    public String toNewCarMain(Model model,@PathVariable("carID") String carID){
//        model.addAttribute(carID);
        model.addAttribute("carID",carID);
//        System.err.println("jsp跳转之前的controller层："+carID);
        return "adCenter/AddCarMain";
    }

    @RequestMapping("/toAdmin")
    public String toAdmin(){
        return "adCenter/admin";
    }

    @RequestMapping("/toNewCarDesc/{carID}")
    public String toNewCarDesc(Model model,@PathVariable("carID") String carID){
        model.addAttribute("carID",carID);
        return "adCenter/AddCarDesc";
    }
}
